home *** CD-ROM | disk | FTP | other *** search
- /* SymbolicIsItInThere.c */
- /*****************************************************************************/
- /* */
- /* Out Of Phase: Digital Music Synthesis on General Purpose Computers */
- /* Copyright (C) 1994 Thomas R. Lawrence */
- /* */
- /* This program is free software; you can redistribute it and/or modify */
- /* it under the terms of the GNU General Public License as published by */
- /* the Free Software Foundation; either version 2 of the License, or */
- /* (at your option) any later version. */
- /* */
- /* This program is distributed in the hope that it will be useful, */
- /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
- /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
- /* GNU General Public License for more details. */
- /* */
- /* You should have received a copy of the GNU General Public License */
- /* along with this program; if not, write to the Free Software */
- /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- /* */
- /* Thomas R. Lawrence can be reached at tomlaw@world.std.com. */
- /* */
- /*****************************************************************************/
-
- #include "MiscInfo.h"
- #include "Audit.h"
- #include "Debug.h"
- #include "Definitions.h"
-
- #include "SymbolicIsItInThere.h"
- #include "Memory.h"
- #include "DataMunging.h"
-
-
- /* case insensitive thing to see if a string is in another string. returns the position */
- /* if it was found or -1 if not found. */
- MyBoolean IsItInThere(char* Block, char* NullTermThing)
- {
- long BlockLen;
- long NullTermLen;
- long Index;
-
- CheckPtrExistence(Block);
- BlockLen = PtrSize(Block);
- NullTermLen = StrLen(NullTermThing);
- for (Index = 0; Index + NullTermLen <= BlockLen; Index += 1)
- {
- PRNGCHK(Block,&(Block[Index]),NullTermLen);
- if (MemEquNoCase(&(Block[Index]),NullTermThing,NullTermLen))
- {
- return True;
- }
- }
- return False;
- }
-